<?php
$host = 'localhost';
$username = ''; //数据库用户名
$password = ''; //数据库密码
$dbname = ''; //保存数据的数据库名称
$id = $_POST['id'];
$name = $_POST['name'];
$mysql = new mysqli($host, $username, $password, $dbname);
if ($mysql->connect_errno) {
    die('数据库连接失败：' . $mysql->connect_errno);
} else {
    $mysql->set_charset('UTF-8'); //  设置数据库字符集
    $sql = "INSERT INTO readerinfo (reader_name,reader_id) VALUES ('$name','$id')";         // SQL 语句
    $result = $mysql->query($sql);
    if ($result)
        echo "<script>alert('添加成功！')</script>";
    else echo "<script>alert('添加失败！')</script>";
    $mysql->close();
}
?>
<a href="readerinfo.html">继续加入</a> 或者 <a href="homepage.html">回到首页</a>